package edu.hawaii.duedates;

import java.util.List;
import com.meterware.httpunit.WebConversation;

/**
 * An abstract representation of a Lender-Borrower relationship which is extended to specify due
 * date data collection depending on Lender criteria and user needs.
 * 
 * @author Aric West
 * @author Daniel Tian
 * 
 */
public abstract class LenderQuery {

  /**
   * Logs into lender website and navigates to page containing due dates.
   * 
   * @return WebConversation
   * @throws Exception an exception
   */
  protected abstract WebConversation logIn() throws Exception;

  /**
   * Gathers due date info from webpage.
   * 
   * @return string
   * @throws Exception an exception
   */
  public abstract List<BorrowedItem> getBorrowedItems() throws Exception;

  /**
   * Returns the expected number of fields that the class will use.
   * 
   * @return expected number of fields
   */
  public abstract int getExpectedFieldLength();

  /**
   * Returns the lender's name.
   * 
   * @return The lender's name.
   */
  public abstract String getLenderName();
  
  /**
   * Sets the fields required by the class to log in.
   * 
   * @param fieldList a list containing all the fields
   * @throws Exception number of fields passed is not equal to the number of fields expected
   */
  public abstract void setFields(List<String> fieldList) throws Exception;
}
